function factorial(fNum){
	if (fNum<=1){
		return 1;
		}
	else{
		return (fNum*(factorial(fNum-1)));
		}
}
var enterNum=prompt("Enter the value");
enterNum=parseInt(enterNum);
document.write(factorial(enterNum));